<?php

namespace App\Admin\Extensions;

use App\Model\UserCancelLog;
use Encore\Admin\Admin;

class UserCancelLogOp extends BaseAction
{
    protected function render()
    {
        Admin::script($this->script($this->actionUrl));
        $btn = $this->buildButton('ok', '直接注销', ['id' => $this->id, 'status' => UserCancelLog::FLAG_OK]);
        $failbtn = $this->buildButton('fail', '撤销注销', ['id' => $this->id, 'status' => UserCancelLog::FLAG_FAIL]);
        $str = [];
        if ($this->row->flag == UserCancelLog::FLAG_ING) {
            $str[] = $btn;
            $str[] = $failbtn;
        }
        return implode('<br/><br/>', $str);
    }
}
